﻿@model SnippetBox.Core.Infrastructure.Settings
@{
    ViewBag.Title = "Settings";
    ViewBag.BodyId = "settings";
}
    <h1>Settings</h1>

    <ul class="tabs" id="settingsTabs">
    @foreach (var prop in ViewData.ModelMetadata.Properties.Where(pm => pm.ShowForEdit && pm.ContainerType.IsSubclassOf(typeof(SnippetBox.Core.Infrastructure.SettingsBase)))) { 
        var name = prop.DisplayName ?? prop.PropertyName;
        <li><a href="#@name.ToLower()" class="@name.ToLower()">@name</a></li>
    } 
    </ul>

    @using (Html.BeginForm()) {
        @Html.ValidationSummary(false)

        @Html.EditorForModel()

        <p class="buttonRow">
            @Html.ActionLink("cancel", "Index", null, new { @class = "cancelLink" })
            <input type="submit" value="Save" />
        </p>
    }

    <script type="text/javascript">$(snippetBox.settings.init)</script>

